package com.happle.gcmclient.backendmanager.task;

import android.os.AsyncTask;
import android.util.Log;
import com.happle.gcmclient.backendmanager.BackendManager;
import com.happle.gcmclient.config.Constants;

/**
 * Created by Inna on 05.11.13.
 */
public class SendChangeStatusTask extends AsyncTask <Void, Void, Integer>{
    private String regId = "";
    private int status = Constants.STATUS_OFF;

    public SendChangeStatusTask(String regId, int user_status) {
        this.regId = regId;
        this.status = user_status;
    }

    @Override
    protected Integer doInBackground(Void... params) {
        int result = Constants.FAILED;
        try {
            BackendManager bManager = new BackendManager();
            result = bManager.sendChangeStatus(regId, status);
        } catch (Exception e) {
            e.printStackTrace();
        }
        Log.d("SendChangeStatusTask", String.valueOf(result));
        return result;
    }
}
